package stack.era.presentation.hud;

import java.awt.Color;

import stack.era.domain.DomainHome;
import stack.era.presentation.ERAInfoBar;

public class PlayerFatigueBar extends ERAInfoBar {

	private static final long serialVersionUID = 2863386214930469042L;

	public PlayerFatigueBar() {
		super(new Color(50, 230, 50));

		this
				.setToolTipText("<html><body>Fatigue is decreased every time you perform any action.<br>When you run out of fatigue, you become tired and<br>recieve major penalties to anything you do.</body></html>");
	}

	public void populate() {
		DomainHome domain = DomainHome.getInstance();
		String playerCharName = domain.getWorld().getPlayerCharacterName();
		if (playerCharName != null) {
			this.value = domain.getCharacter(playerCharName).getFatigue();
			this.maxValue = domain.getCharacter(playerCharName).getMaxFatigue();
		}
	}

	@Override
	public String getBarString() {
		return this.value + "/" + this.maxValue;
	}

}
